package com.cham.user.service.impl;

import com.cham.user.dto.UserInfo;
import com.cham.user.entity.User;
import com.cham.user.mapper.HeadImgMapper;
import com.cham.user.mapper.UserMapper;
import com.cham.user.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author Howl-Xu
 * @version 1.0.0
 * @Description: 请描述一下这个类文件吧
 * @createTime 2020年03月14日 10:26:00
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Resource
    private HeadImgMapper headImgMapper;

    @Override
    public User getUserByAccountAndPassword(String account, String password) {
        return userMapper.getUserByAccountAndPassword(account, password);
    }

    @Override
    public String getUserHeadImgByUUID(String uuid) {
        return headImgMapper.getUserHeadImgByUUID(uuid);
    }

    @Override
    public UserInfo getUserInfoByUserUUID(String uuid) {
        return userMapper.getUserInfoByUserUUID(uuid);
    }

    @Override
    public void register(User user) {
        userMapper.register(user);
    }

    @Override
    public void updateUserInfo(UserInfo userInfo) {
        userMapper.updateUserInfo(userInfo);
    }

    @Override
    public void updateHeadImg(UserInfo userInfo) {
        userMapper.updateHeadImg(userInfo);
    }
}
